package cn.base.web.cahe;

import java.time.Duration;

/**
 * 临时缓存
 */
public interface TemporaryCache {

    /**
     * 放入缓存&指定超时时间
     * @param key
     * @param value
     * @param timeout
     */
    void set(String key, Object value, Duration timeout);

    Object get(String key);

    Object getAndExpire(String key, Duration timeout);

    void delete(String key);

}
